﻿<UserControl x:Class="SLExtensions.Showcase.PageAnimMargin"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:sleca="clr-namespace:SLExtensions.Controls.Animation;assembly=SLExtensions.Controls"
    xmlns:slei="clr-namespace:SLExtensions.Input;assembly=SLExtensions"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="537" d:DesignHeight="427"
    
    >
	<UserControl.Resources>
		<Storyboard x:Name="sbZIndex">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" AutoReverse="True" RepeatBehavior="Forever" 
                                           Storyboard.TargetProperty="(s">
                <!--<sleca:PropertyPath.PropertyPath>
                    <sleca:PropertyPath Type="SLExtensions.Controls.Animation.ZIndexWrapper" AttachedProperty="ZIndex" />
                </sleca:PropertyPath.PropertyPath>-->
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="6"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
    <Canvas x:Name="LayoutRoot" Background="White">
    	<Rectangle Height="166" Width="153" Canvas.Left="183" Canvas.Top="53" Fill="#FF0044FF" Stroke="#FF000000" x:Name="rectangle" sleca:ZIndexWrapper.ZIndex="0"/>
    	<Rectangle Height="130" Width="136" Canvas.Left="134" Canvas.Top="113" Fill="#FFFF0000" Stroke="#FF000000" Canvas.ZIndex="1"/>
    	<Rectangle Height="130" Width="136" Fill="#FFDAFF00" Stroke="#FF000000" Canvas.Left="167" Canvas.Top="140" Canvas.ZIndex="2"/>
    	<Rectangle Height="130" Width="136" Fill="#FF00FF88" Stroke="#FF000000" Canvas.Left="200" Canvas.Top="165" Canvas.ZIndex="3"/>
    	<Rectangle Height="130" Width="136" Fill="#FF0044FF" Stroke="#FF000000" Canvas.Left="232" Canvas.Top="190" Canvas.ZIndex="4"/>
        
        <Button Content="Start anim" slei:CommandService.Command="BeginStoryboard" slei:CommandService.CommandParameter="sbZIndex" />
    </Canvas>
</UserControl>
